window.onload = function () {
    var mydiv = document.getElementById("mydiv");
    // (mydiv as HTMLElement).style.backgroundColor="pink"
    if (mydiv instanceof HTMLElement) {
        mydiv.style.backgroundColor = "pink";
    }
};
